package com.lgd.springboot;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * Created by 299174105 on 2017/8/15.
 */
@RestController
public class HelloWorldController {
    @RequestMapping("/hello")
    public String getHello(){
        return "Hello World!";
    }

    @RequestMapping("/person")
    public Person getPerson(){
        Person person = new Person();
        person.setName("tom");
        person.setAge(18);
        person.setCity("beijing");
        person.setBirthday(new Date());
        return person;
    }

    @RequestMapping("/person2")
    public Person getPerson2(){
        Person person = new Person();
        person.setBirthday(new Date());
        person.setName("jerry1");
        person.setAge(177);
        person.setCity("beijing");
        return person;
    }
    @RequestMapping("/hello2")
    public String getHello1(){
        return "hello2";
    }

}
